#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <time.h>
#include <stdlib.h>

void meau()
{
    printf("********************************\n");
    printf("********************************\n");
    printf("**************1.play************\n");
    printf("**************0.exit************\n");
    printf("********************************\n");
    printf("********************************\n");
}

void game()
{
    int guess,value;
    value = rand() % 100 + 1;
 
    while (1) {
        printf("Guess what? >");
        scanf("%d", &guess);
        if (guess > value) {
            printf("Bigger!\n");
        }
        else if (guess < value) {
            printf("Smaller!\n");
        }
        else {
            printf("Success!\n");
            break;
        }
    }

}
int main()
{
    int input = 0;
    meau();
    srand((unsigned int)time(NULL));

    while (1) {
        printf("Enter> ");
        scanf("%d", &input);
        switch (input)
        {
        case 0:
            return 0;
        case 1:
            game();
            break;
        default:
            printf("Error! Please enter again> \n");
        }
    }
    return 0;
}